package com.spring.cloud.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.stereotype.Service;

/**
 * @author duan
 * @version 1.0
 * @date 2023/6/12 19:26
 */
@Service
public class GreetingService {

    @HystrixCommand(fallbackMethod = "defaultGreeting")
    public String getGreeting(String username) {
        return "hello, " + username;
    }

    private String defaultGreeting(String username) {
        return "Hello User!";
    }
}
